﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ExpreRec.DataAccess;

namespace ExpreRec.UI
{
    public partial class ParamListForm : Form
    {
        private static ConstDAL constDAL = new ConstDAL();
        private static VariableDAL variableDAL = new VariableDAL();

        public ParamListForm()
        {
            InitializeComponent();
        }

        private void addToList(IList<KeyValuePair<string, string>> args, bool changeFlag)
        {
            foreach (KeyValuePair<string, string> pair in args)
            {
                ListViewItem item = new ListViewItem(pair.Key);
                item.SubItems.Add(pair.Value);
                item.SubItems.Add(changeFlag ? "可变" : "不可变");

                listArgs.Items.Add(item);
            }
        }

        private void ParamListForm_Load(object sender, EventArgs e)
        {
            this.WindowState = FormWindowState.Maximized;
            addToList(constDAL.GetList(), false);

            addToList(variableDAL.GetList(), true);
        }
    }
}
